import os

from ament_index_python.packages import get_package_share_directory, get_package_prefix
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():

    def get_params(name):
        return os.path.join(get_package_share_directory(name), 'config', 'params.yaml')
    
    detect_node = Node(
            package='detect_template_node',
            executable='detect_node',
            name='detect_node',
            output='both',
            emulate_tty=True,
            parameters=[get_params('detect_template_node')],
            ros_arguments=[],
        )

    return LaunchDescription([
            detect_node
    ])
